package com.ruoyi.project.system.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.mapper.SysUserCustomerMapper;
import com.ruoyi.project.system.domain.SysUserCustomer;
import com.ruoyi.project.system.service.ISysUserCustomerService;

/**
 * 用户与经销商关联Service业务层处理
 *
 * @author anan
 * @date 2021-05-05
 */
@Service
public class SysUserCustomerServiceImpl extends ServiceImpl<SysUserCustomerMapper,SysUserCustomer> implements ISysUserCustomerService
{
    @Autowired
    private SysUserCustomerMapper sysUserCustomerMapper;

    /**
     * 查询用户与经销商关联
     *
     * @param userId 用户与经销商关联ID
     * @return 用户与经销商关联
     */
    @Override
    public SysUserCustomer selectSysUserCustomerById(Long userId)
    {
        return sysUserCustomerMapper.selectSysUserCustomerById(userId);
    }

    /**
     * 查询用户与经销商关联列表
     *
     * @param sysUserCustomer 用户与经销商关联
     * @return 用户与经销商关联
     */
    @Override
    public List<SysUserCustomer> selectSysUserCustomerList(SysUserCustomer sysUserCustomer)
    {
        return sysUserCustomerMapper.selectSysUserCustomerList(sysUserCustomer);
    }

    /**
     * 新增用户与经销商关联
     *
     * @param sysUserCustomer 用户与经销商关联
     * @return 结果
     */
    @Override
    public int insertSysUserCustomer(SysUserCustomer sysUserCustomer)
    {
        return sysUserCustomerMapper.insertSysUserCustomer(sysUserCustomer);
    }

    /**
     * 修改用户与经销商关联
     *
     * @param sysUserCustomer 用户与经销商关联
     * @return 结果
     */
    @Override
    public int updateSysUserCustomer(SysUserCustomer sysUserCustomer)
    {
        return sysUserCustomerMapper.updateSysUserCustomer(sysUserCustomer);
    }

    /**
     * 批量删除用户与经销商关联
     *
     * @param userIds 需要删除的用户与经销商关联ID
     * @return 结果
     */
    @Override
    public int deleteSysUserCustomerByIds(Long[] userIds)
    {
        return sysUserCustomerMapper.deleteSysUserCustomerByIds(userIds);
    }

    /**
     * 删除用户与经销商关联信息
     *
     * @param userId 用户与经销商关联ID
     * @return 结果
     */
    @Override
    public int deleteSysUserCustomerById(Long userId)
    {
        return sysUserCustomerMapper.deleteSysUserCustomerById(userId);
    }
}